<template>
	<view class="picture-style">
		<view v-for="(item_image ,image_index)  in pictures" :key="image_index">
			<u-image :src="item_image" @click="picturesPreview(image_index)" :width="width+'rpx'"
				:height="height+'rpx'">
			</u-image>
		</view>
	</view>
</template>

<script>
	export default {
		name: "previewImage",
		props: {
			pictures: {
				type: Array,
			},
			width: {
				type: [Number, String],
				default: 145
			},
			height: {
				type: [Number, String],
				default: 145
			}
		},
		data() {
			return {

			};
		},
		methods: {
			// 预览图片
			picturesPreview(index) {
				let imgs = this.pictures.map(item => {
					return item
				})
				uni.previewImage({
					urls: imgs,
					current: index
				})
			},
		}
	}
</script>

<style lang="scss">
	// 图片flex布局样式
	.picture-style {
		display: flex;
		// justify-content: space-between;
		flex-wrap: wrap;

		>view {
			margin: 8rpx;
		}
	}
</style>
